function A_nature = orth_base_func(X,K)
A_nature=zeros(K+1,K+1);
A_nature(1,1)=1;
for iiK=1:K
    orth_base1 = orth_base_func2(A_nature(:,iiK),X);
    a2=(X.*orth_base1)'*orth_base1/(orth_base1'*orth_base1);
    A_nature(2:iiK+1,iiK+1)=A_nature(1:iiK,iiK);
    A_nature(1:iiK,iiK+1)=A_nature(1:iiK,iiK+1)-A_nature(1:iiK,iiK)*a2;
    if iiK>1
        orth_base0 = orth_base_func2(A_nature(:,iiK-1),X);
        b1=(orth_base1'*orth_base1)'/(orth_base0'*orth_base0);
        A_nature(1:iiK-1,iiK+1)=A_nature(1:iiK-1,iiK+1)-A_nature(1:iiK-1,iiK-1)*b1;
    end
end
end

